package test.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;

/**
 * @author DengZhiYuan
 * @version 1.0
 * @date 2022/12/2 19:44
 */
public class ExcelListener extends AnalysisEventListener<HospitalEntity> {

    //创建list集合封装最终的数据
    List<HospitalEntity> list = new ArrayList<HospitalEntity>();
    @Override
    public void invoke(HospitalEntity hospitalEntity, AnalysisContext analysisContext) {
        list.add(hospitalEntity);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    public List<HospitalEntity> getList() {
        return list;
    }

    public void setList(List<HospitalEntity> list) {
        this.list = list;
    }
}
